package student;

import java.util.ArrayList;
import java.util.List;

public class StuApp {
    static List<Student> list=new ArrayList<>();//静态调用静态 静态里面的对象也得静态
    public static void main(String[] args) {

        init();
       /* Tools tools=new Tools();
        tools.getAvg(list);*/
        double ret=Tools.getAvg(list);  //静态方法  直接类名.方法名
        System.out.println("平均分是："+ret);
        //最高分
        Student ret1=Tools.getMax(list);
        System.out.println("最高分的学生是:"+ret1);
        //不及格的学生
        List<Student> stus=Tools.getScore(list,80,90);
        System.out.println("80----90之间学生是"+stus);
        List<Student> stus2=Tools.getScore(list,70,80);
        System.out.println("70----80之间学生是"+stus2);
    }
    //数据初始化
    public static void init(){

        list.add(new Student("唐凯悦","41926081",90));
        list.add(new Student("彭真","41926084",85));
        list.add(new Student("阎佳","41926022",56));
        list.add(new Student("汪龙","41926010",80));
        list.add(new Student("李安典","41926038",78));
        list.add(new Student("李泽轩","41926006",45));
    }
}
